#ifndef OBJECTSMANAGER_H
#define OBJECTSMANAGER_H

#include <grouptreeitem.h>
#include <scene.h>
#include <QList>

class SceneObject
{
private:
  Category    _category;
  QString     _name;
  QString     _filename;


public:
  SceneObject();

  void SetCategory (const Category& category);
  Category& GetCategory ();
  const Category& GetCategory () const;

  void SetName (const QString& name);
  const QString& GetName ()const;

  void SetFilename (const QString& filename);
  const QString& GetFilename () const;

};

class ObjectManager : public QObject
{
  Q_OBJECT
private:
  QList<SceneObject*>  _objects;

public:
  ObjectManager();


  void AddObject (SceneObject* object);
  void RemoveObject (SceneObject* object);
  void MoveObject (SceneObject* object);
  void ChangeObject (SceneObject* object);

  void RenameCategory (Category catOld, Category catNew);
  void RemoveCategory(Category category);

  unsigned GetNumberOfObjects () const;
  SceneObject* GetObject (unsigned idx);

  bool Load ();
  void Save ();


signals:
  void ObjectAdded (SceneObject* object);
  void ObjectRemoved (SceneObject* object);
  void ObjectMoved (SceneObject* object);
  void ObjectChanged (SceneObject* object);
};

#endif // OBJECTSMANAGER_H
